package com.nintendo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nintendo.pojo.ChatMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ChatMessageMapper extends BaseMapper<ChatMessage> {
    @Select("select *\n" +
            "from chat_message where (receiver_id = #{friendId} and sender_id = #{myId}) or(receiver_id = #{myId} and sender_id = #{friendId})  order by chat_time asc ")
    List<ChatMessage> findChatMessageListByPage(String myId, String friendId);
    @Select("select *\n" +
            "from chat_message where (receiver_id = #{friendId} and sender_id = #{myId}) or(receiver_id = #{myId} and sender_id = #{friendId})  order by chat_time asc ")
    List<ChatMessage> findChatMessageListAll(String myId, String friendId);
}
